package com.chanzany.factory.simpleFactory.improve;

public class SimpleFactory {
    public static Pizza createPizza(String orderType) {
        Pizza pizza;
        switch (orderType) {
            case "greek":
                pizza = new GreekPizza();
                pizza.setName(" 希腊披萨 ");
                break;
            case "cheese":
                pizza = new CheesePizza();
                pizza.setName(" 奶酪披萨 ");
                break;
            case "pepper":
                pizza = new PepperPizza();
                pizza.setName("胡椒披萨");
                break;
            default:
                throw new IllegalStateException("Unexpected value: " + orderType);
        }
        return pizza;

    }
}